Termination w.r.t. Q of the following Term Rewriting System could be proven:
Q restricted rewrite system:
The TRS R consists of the following rules:
fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, n__fib1(Y, n__add(X, Y)))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, activate(XS))
fib1(X1, X2) → n__fib1(X1, X2)
add(X1, X2) → n__add(X1, X2)
activate(n__fib1(X1, X2)) → fib1(activate(X1), activate(X2))
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(X) → X
Q is empty.
↳ QTRS
↳ DirectTerminationProof
Q restricted rewrite system:
The TRS R consists of the following rules:
fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, n__fib1(Y, n__add(X, Y)))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, activate(XS))
fib1(X1, X2) → n__fib1(X1, X2)
add(X1, X2) → n__add(X1, X2)
activate(n__fib1(X1, X2)) → fib1(activate(X1), activate(X2))
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(X) → X
Q is empty.
We use [23] with the following order to prove termination.
Recursive path order with status [2].
Quasi-Precedence:
fib1 > sel2 > activate1 > fib12 > [cons2, nfib12, nadd2]
fib1 > sel2 > activate1 > add2 > s1 > [cons2, nfib12, nadd2]
fib1 > 0 > [cons2, nfib12, nadd2]
Status: sel2: [1,2]
nadd2: [2,1]
add2: [2,1]
fib1: [1]
s1: multiset
0: multiset
cons2: multiset
fib12: multiset
nfib12: [1,2]
activate1: [1]